//
//  NSArray+HLENetWork.m
//  HLENetwork_Example
//
//  Created by hle1879 on 2020/9/29.
//  Copyright © 2020 13434436448@163.com. All rights reserved.
//

#import "NSArray+HLENetWork.h"

@implementation NSArray (HLENetWork)

- (NSString *)descriptionWithLocale:(nullable id)locale indent:(NSUInteger)level{
    return [self formatString];
}

- (NSString *)debugDescription{
    return [self formatString];
}

- (NSString*)formatString{
    NSMutableString *arrayString = [NSMutableString new];
    [arrayString appendString:@"["];
    [arrayString appendString:@"\n"];
    [self enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        [arrayString appendFormat:@"\t%@,",obj];
        [arrayString appendString:@"\n"];
    }];
    [arrayString appendString:@"]"];
    
    NSRange range = [arrayString rangeOfString:@"," options:NSBackwardsSearch];
    if (range.location != NSNotFound)
        [arrayString deleteCharactersInRange:range];
    
    return arrayString;
}
@end
